package com.base.myproject.client.ui;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.SummaryColumnConfig;

public class GroupCheckBoxSelectionModel<M extends ModelData> extends CheckBoxSelectionModel<M>{
	
	public GroupCheckBoxSelectionModel()
	{
		 super();
		 config = newSumConfig(); 
		 config.setId("checker");
		    config.setWidth(20);
		    config.setSortable(false);
		    config.setResizable(false);
		    config.setFixed(true);
		    config.setMenuDisabled(true);
		    config.setDataIndex("");
		    config.setRenderer(new GridCellRenderer<M>() {
		      public String render(M model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<M> store,
		          Grid<M> grid) {
		        config.cellAttr = "rowspan='2'";
		        return "<div class='x-grid3-row-checker'>&#160;</div>";
		      }
		    });
	}
	private SummaryColumnConfig newSumConfig() {
		// TODO Auto-generated method stub
		return new SummaryColumnConfig();
	}  
	 protected void handleMouseDown(GridEvent<M> e) {
		 super.handleMouseDown(e);
	 }
}
